package com.qiaomengapp.controller;

import java.util.List;

import javax.annotation.Resource;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import com.qiaomengapp.bean.ProviderGood;
import com.qiaomengapp.exception.CustomException;
import com.qiaomengapp.service.IProvideGoodService;

@Controller
@RequestMapping("provideGood")
public class ProvideGoodController {
	@Resource
	private IProvideGoodService service;
	
	//显示所有的provide_good
	@RequestMapping("showHtml")
	@ResponseBody
	public List<ProviderGood> showHtml(){
		try {
			List<ProviderGood> list = service.select_ProviderGood();
			return list;
		} catch (CustomException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		return null;
	}
	//模糊查询
	@RequestMapping("selectByGoodName")
	@ResponseBody
	public List<ProviderGood>selectByGoodName(String goodDesc){
			List<ProviderGood> list = service.select_mohu(goodDesc);
			return list;
	}
}
